﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BilbilDAL;
using Common;

namespace BilbilBLL
{
    public class CollectionServer
    {
        /// <summary>
        /// 根据用户信息id和视频信息id添加关注记录
        /// </summary>
        /// <param name="userInfoId"></param>
        /// <param name="videoInfoId"></param>
        /// <returns></returns>
        public ResponseTool AddCollectionInfo(int userInfoId, int videoInfoId)
        {
            if (userInfoId == 0 || videoInfoId == 0) { return ResponseTool.Fail("用户信息Id和视频信息Id不能为空"); }
            return ResponseTool.Succeed(new CollectionDAL().AddCollectionInfo(userInfoId, videoInfoId) ? "关注成功":"关注失败");
        }
        /// <summary>
        /// 根据用户信息id和视频信息id删除关注记录
        /// </summary>
        /// <param name="userInfoId"></param>
        /// <param name="videoInfoId"></param>
        /// <returns></returns>
        public ResponseTool DeleteCollectionInfo(int userInfoId, int videoInfoId)
        {
            if (userInfoId == 0 || videoInfoId == 0) { return ResponseTool.Fail("用户信息Id和视频信息Id不能为空"); }
            return ResponseTool.Succeed(new CollectionDAL().DeleteCollectionInfo(userInfoId, videoInfoId) ? "取关成功" : "取关失败");
        }
    }
}
